package com.woniuxy.usercoachassemble.filter;

/**
 * ClassName: CorsFilter
 * Description: 解决跨域问题
 * date: 2020/7/14 15:01
 *
 * @author Fy浪迹、
 */
//@WebFilter
//@Configuration
//public class CorsFilter implements Filter {
//
//    @Override
//    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
//        HttpServletResponse resp = (HttpServletResponse) response;
//        resp.setHeader("Access-Control-Allow-Origin","*");
//        resp.setHeader("Access-Control-Allow-Credentials", "true");
//        resp.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT");
//        resp.setHeader("Access-Control-Max-Age", "3600");
//        resp.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept,userId");
//        chain.doFilter(request, resp);
//    }
//}
